#!/bin/bash
ping -c 1 -W 1 $1 > /dev/null
if [ \$? -eq 0 ]; then
  echo "成功"
else
  echo "失败"
fi

